package cn.vetech.sync.elasticsearch.controller;

import cn.vetech.sync.elasticsearch.model.response.Response;
import cn.vetech.sync.elasticsearch.service.DataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/data/")
public class DataController {

    @Autowired
    private DataService dataService;

    @RequestMapping("/list")
    public Response<List<Map<String, Object>>> list() {
        List<Map<String, Object>> mapping=dataService.getMapping();
        return new Response(mapping);
    }
}
